package com.yuanian.timingwheel.config;


import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;
import java.util.ArrayList;
import java.util.List;

//@Configuration
public class EbeanConfig {

   /* final DataSource dataSource;

    public EbeanConfig(@Qualifier("dataSource") DataSource dataSource) {
        this.dataSource = dataSource;
    }

    @Bean
    public Database ebeanServer() {
        DatabaseConfig config = new DatabaseConfig();
        config.setDataSource(dataSource);
        config.setDefaultServer(true);
        config.setRegister(true);
        //是否生成建表SQL
        config.setDdlGenerate(true);
        //是否跳过建表SQL
        config.setDdlCreateOnly(false);
        //是否执行建表SQLs，不建议设置为true
        config.setDdlRun(false);
        List<String> list = new ArrayList<>();
        list.add("com.yuanian.timingwheel");
        config.setPackages(list);
        return DatabaseFactory.create(config);
    }*/
}
